package com.dimong.loan.sdk.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
import com.j256.ormlite.support.ConnectionSource;

public abstract class DBHelper extends OrmLiteSqliteOpenHelper
{
    public DBHelper(Context context,String daName,int dbVersion) {
        super(context, daName, null, dbVersion);
    }

    @Override
    public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {
        createDBTable(connectionSource);
    }

    @Override
    public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource, int oldVersion, int newVersion) {
        upGradeDBTable(connectionSource,oldVersion,newVersion);
    }

    public abstract void createDBTable(ConnectionSource connectionSource);

    public abstract void upGradeDBTable(ConnectionSource connectionSource,int oldVersion, int newVersion);
}
